<?php
// Load the database class
// As a practice of efficiency, the folowing two lines could be placed
// in a 'global' include file so that this class would be available to
// every application where the 'global' include file was included,
// i.e. a global header.
require('database_class.php'); // If you're using the 'classloader.php' module you could omit this line
$database = new database();

// Example Usage
$database->executeQuery("SELECT * FROM user_tbl WHERE NAME = 'Najeeb Ahmad'");
$num_rows = $database->num_rows();
if ($num_rows != 0) {
    while ($row = $database->fetch_array()) {
        $var_1 = $row['ID'];
        $var_2 = $row['NAME'];
        $var_3 = $row['EMAIL'];
    }
    // OR
   /* while ($row = $database->fetch_object()) {
        $var_1 = $row->col_name_1;
        $var_2 = $row->col_name_2;
        $var_3 = $row->col_name_3;
    }*/
}
$database->clean_results();

// Delete w/affected_rows
//$database->delete("DELETE FROM table_name WHERE column_name = 'some_value'");
if($database->affected_rows() > 0) {
    // Success!
}

$database->close();

echo 'var 1'.$var_1.'<br />';
echo $var_2.'<br />';
echo $var_3.'<br />';
?>
